#include "mystdio.h"
#include <string.h>
#include <unistd.h>

const char *filename = "./log.txt";

int main()
{
    myFILE *fp = my_fopen(filename, "w");
    if (fp == NULL)
        return 1;

    int cnt = 5;
    char buffer[64];
    while (cnt)
    {
        snprintf(buffer, sizeof(buffer), "helloworld,hellobit,cnt:%d", cnt--);
        my_fwrite(fp, buffer, strlen(buffer));
        DebugPrint(fp);
        sleep(2);
    }

    my_fclose(fp);
    return 0;
}